﻿using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NCD.QuartzTask
{
    [PersistJobDataAfterExecution] //执行后可以保留执行结果
    [DisallowConcurrentExecution] // 防止并行执行   
    public class TestQuartzJob1 : IJob
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public Task Execute(IJobExecutionContext context)
        {
            return Task.Factory.StartNew(() =>
            {
                Console.WriteLine($"执行任务: TestQuartzJob1,执行时间：{DateTime.Now.ToString("HH:mm:ssFFFFFFF")}");
            });
        }
    }
}